import request from "@/utils/request.js";

export function compareHistoryRecord(currentId, historyId) {
    return request({
        url: '/record/record/compareHistoryRecord',
        method: 'get',
        params: {
            currentId: currentId,
            historyId: historyId
        }
    })
}

/**
 * 检查是否有未完成的测评记录
 * @param paperId
 * @returns {*}
 */
export function checkRecord(paperId) {
    return request({
        url: '/record/record/checkRecord/' + paperId,
        method: 'get',
    })
}

/**
 * 添加一条测评记录
 * @param paperId
 * @returns {*}
 */
export function addRecord(paperId) {
    return request({
        url: '/record/record/add/' + paperId,
        method: 'post',
    })
}

/**
 * 提交测评卷
 * @returns {*}
 * @param paperId
 */
export function submitPaper(paperId) {
    return request({
        url: '/record/record/submitPaper/' + paperId,
        method: 'post',
    })
}

/**
 * 点击退出测评时保存当前测评卷
 * @param paperId
 * @returns {*}
 */
export function saveCurrentRecord(paperId) {
    return request({
        url: '/record/record/saveCurrentRecord/' + paperId,
        method: 'post',
    })
}

/**
 * 重新测评
 * @param paperId
 * @returns {*}
 */
export function retestAssessment(paperId) {
    return request({
        url: '/record/record/retestAssessment/' + paperId,
        method: 'post',
    })
}

/**
 * 获取最近的一次历史测评记录
 * @param paperId
 * @returns {*}
 */
export function getHistoryData(paperId) {
    return request({
        url: '/record/record/getHistoryData/' + paperId,
        method: 'get',
    })
}
